home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Games / PC-SIG World of Games (CDRM1080710) (1993).iso / ENT / DISK1000.ZIP / NETHACK.ZIP / BUGFIX next >
Text File  |  1992-04-30  |  4KB  |  115 lines

  1.     Due to the overwhelming number of requests for the code diffs to
  2. fix NetHack pl 10 for a PC this diff is being posted.  This diff will also
  3. be available for anonymous ftp from linc.cis.penn.edu.
  4.  
  5.     This diff is a patch for a Nethack 3.0 code set at patch level 10.
  6. This diff was developed under the supervision of the NetHack PC dev
  7. with special thanks to Yoshiaki Kasahara for pointing us in the right
  8. direction.
  9.  
  10.     This diff is a fix to the two bugs in patchlevel 10 of the code
  11. that cause unplayable binaries to be built.  The o_init.c diff fixes the
  12. "scrambling" of names of objects when the game is saved in one set of
  13. memory conditions, and restored under another.  The Makefile diff will
  14. fix an MSC optimization oddity that caused problems with our first
  15. binary release.  The purpose of this diff is to fix these bugs in the
  16. *MSDOS PC* port of the game.
  17.  
  18.     This code is not recommended for use to fix *any* other
  19. bugs in *any* other port of NetHack.  If you are experiencing any bug other
  20. in a different port of the game, please contact
  21.     nethack-bugs@linc.cis.upenn.edu
  22.  
  23.     Lastly, note that this is diff is only being released because of
  24. inadquate testing on the part of the PC team.  NetHack 3.0 code is no longer
  25. under development by the dev team.
  26.  
  27.     Good luck and Hack On!
  28.  
  29.                             - The PC team.
  30.  
  31. ===== Begin Diff ===== 82 lines =====
  32. *** o_init.co    Thu Feb 28 12:49:50 1991
  33. --- o_init.c    Thu Feb 28 12:55:32 1991
  34. ***************
  35. *** 273,280 ****
  36.   {
  37.       register int i;
  38.       unsigned int len;
  39. !     char *then;    /* old location of "strange object" */
  40. !     register int differ;    /*(ptrdiff_t)*/
  41.   #ifdef MACOS
  42.       /* provides position-independent save & restore */
  43.       /* by giving each object a number, keep track of it */
  44. --- 273,281 ----
  45.   {
  46.       register int i;
  47.       unsigned int len;
  48. !     char *then;            /* old location of "object name" */
  49. !     char *now = objects[0].oc_name;    /* new location of "object name" */
  50. !     long differ;    /*(ptrdiff_t)*/
  51.   #ifdef MACOS
  52.       /* provides position-independent save & restore */
  53.       /* by giving each object a number, keep track of it */
  54. ***************
  55. *** 305,318 ****
  56.           objects[i].oc_descr = d[switches[i]].descr;
  57.       }
  58.   #else
  59. !     differ = objects[0].oc_name - then;    /* note: expected to be 0 */
  60.   #endif    /* MACOS */
  61.       for(i=0; i < TOTAL_OBJS; i++) {
  62.   #ifndef MACOS
  63.           if (differ && objects[i].oc_name)
  64.               objects[i].oc_name += differ;
  65.           if (differ && objects[i].oc_descr)
  66.               objects[i].oc_descr += differ;
  67.   #endif /* MACOS */
  68.           if (objects[i].oc_uname) {
  69.               mread(fd, (genericptr_t) &len, sizeof len);
  70. --- 306,329 ----
  71.           objects[i].oc_descr = d[switches[i]].descr;
  72.       }
  73.   #else
  74. !     differ = (long)now - (long)then;    /* note: expected to be 0 */
  75.   #endif    /* MACOS */
  76.       for(i=0; i < TOTAL_OBJS; i++) {
  77.   #ifndef MACOS
  78.           if (differ && objects[i].oc_name)
  79. + #ifndef MSDOS
  80.               objects[i].oc_name += differ;
  81. + #else
  82. +             objects[i].oc_name =
  83. +             (const char *)((long)objects[i].oc_name + differ);
  84. + #endif
  85.           if (differ && objects[i].oc_descr)
  86. + #ifndef MSDOS
  87.               objects[i].oc_descr += differ;
  88. + #else
  89. +             objects[i].oc_descr =
  90. +             (const char *)((long)objects[i].oc_descr + differ);
  91. + #endif
  92.   #endif /* MACOS */
  93.           if (objects[i].oc_uname) {
  94.               mread(fd, (genericptr_t) &len, sizeof len);
  95. *** others/Makefile.ovl    Thu Mar 28 20:01:28 1991
  96. --- others/Makefile.ovl    Thu Mar 28 20:02:00 1991
  97. ***************
  98. *** 46,52 ****
  99.   # /Gt22 is currently about the largest value that keeps the initialised data
  100.   # segment below 64K (and keeps the linker happy).
  101.   # 286 or higher machines can use the /G2 CFLAG option for better performance.
  102. ! CFLAGS    = /A$(MODEL) /Oa /Gs /Gt22 /Zp1 /W0 /I$(INCL)
  103.   COSPACE = /Os
  104.   COSPEED = /Os  # MSC 5.1 seems to be broken, or maybe it's the NetHack code.
  105.   #              # Either way, setting COSPEED to /Ot wreaked jolly flaming havoc.
  106. --- 46,52 ----
  107.   # /Gt22 is currently about the largest value that keeps the initialised data
  108.   # segment below 64K (and keeps the linker happy).
  109.   # 286 or higher machines can use the /G2 CFLAG option for better performance.
  110. ! CFLAGS    = /A$(MODEL) /Gs /Gt22 /Zp1 /W0 /I$(INCL)
  111.   COSPACE = /Os
  112.   COSPEED = /Os  # MSC 5.1 seems to be broken, or maybe it's the NetHack code.
  113.   #              # Either way, setting COSPEED to /Ot wreaked jolly flaming havoc.
  114. ===== End Diff ===== 82 lines =====
  115.